package com.xhwl.centiotdata.handler.visitor;

import com.xhwl.centiotdata.handler.pedestrian.PedestrianIntegrationHandler;
import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: yanyixiong
 * @Description:
 * @Date: create in 9:26 2022/3/4
 */
public class VisitorIntegrationFactory {

    /**
     * key-供应商id value-集成类
     */
    private static Map<Integer,VisitorIntegrationHandler>  handlerMap = new HashMap<>();

    public static VisitorIntegrationHandler getInvokeStrategy(Integer id) {
        return handlerMap.get(id);
    }

    public static void register(Integer id, VisitorIntegrationHandler handler) {
        if (StringUtils.isEmpty(id)) {
            return;
        }
        handlerMap.put(id, handler);
    }

}
